﻿@{
    ViewBag.Title = "视频查询";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}

@section JQscriptSection{
    <script type="text/javascript">
        $(document).ready(function () {
            var isFirst = true;
            $("#btnSerach").click(function () {
                if (isFirst)
                    Init();
                else
                {
                    $('#dg').datagrid('reload');
                }
            });
            $("#showVideo").hide();
           // $("#dlg").hide();
            //$("#showVideo").click(function () {
            //    var width = 1000;
            //    var height = 900;
            //    var url = "/Report/VideoShow?orderno=" + $("#txtOrderNo").val() + "&subtype=1";
            //    HandleDialog.ShowDailog("dlg", "视频查看", 200, 50, width, height, true, true, url);
            //});
        });

        //初始化数据
        function Init() {
            var url = "/Report/GetCheckOrdervideo";
            var orderNo = $.trim($("#txtOrderNo").val());
            if (orderNo.length == 0)
            {
                HandleTips.Alert("订单号不能为空");
                return;
            }
            $("#dg").datagrid({
                url: url,
                queryParams: { orderNo: orderNo },
                columns: [[
               { field: 'ORDERNO', title: '订单号', width: 100 },
               { field: 'CHECK_LOCATION', title: '审核位', width: 100 },
               {
                   field: 'CHECKDATE', title: '审核日期', width: 100,
                   formatter: function (value, row, rowIndex) {
                       if (!value) return;
                       return $.dateToString(value);
                   }
               },
               {
                   field: 'CHECKERID', title: '操作', width: 100,
                   formatter: function (value, row, rowIndex) {
                       if (!row.CHECKDATE )
                           return "";
                       var videoUrl = "/Report/VideoShow?orderno=" + row.ORDERNO + "&checkdate=" + row.CHECKDATE + "&checklocation=" + row.CHECK_LOCATION + "&subtype=1";
                       return "<a href='" + videoUrl + "' target='_blank'>查看视频</a>";
                   }
               },
               {
                   field: 'EASTEREGG_CHECK_LOCATION', title: '赠品审核位', width: 100,
                   formatter: function (value, row, rowIndex) {
                       return value;
                   }
               },
               {
                   field: 'EASTEREGG_CHECKDATE', title: '赠品审核日期', width: 100,
                   formatter: function (value, row, rowIndex) {
                       if (!value) return;
                       return $.dateToString(value);// $.dateToString(value);
                   }
               },
               {
                   field: 'EASTEREGG_CHECKERID', title: '赠品操作', width: 100,
                   formatter: function (value, row, rowIndex) {
                       if (!row.EASTEREGG_CHECKDATE || !row.EASTEREGG_CHECK_LOCATION)
                           return "";
                       var videoUrl = "/Report/VideoShow?orderno=" + row.ORDERNO + "&checkdate=" + row.EASTEREGG_CHECKDATE + "&checklocation=" + row.EASTEREGG_CHECK_LOCATION + "&subtype=2";
                       return "<a href='" + videoUrl + "' target='_blank'>查看赠品视频</a>";
                   }
               },
              // {field:'price',title:'Price',width:100,align:'right'}   
                ]],
              //  idField: "ORDERNO",
                method: 'get',
                fit: true,
                pagination: false,
                fitColumns: true,
                singleSelect: true,
                onLoadSuccess: function (data)
                {
                    if (data.IsError)
                        return;
                    if (!data.rows || data.rows.length == 0)
                        HandleTips.Alert("该订单未核单");
                },
                loadFilter:function (data)
                {
                    $.log(data);
                    if (data && !(data instanceof Array)) {
                        alert(data.Message);
                        return { rows: [], IsError: true };
                    }
                    else
                        return { rows: data };
                }
            });            
        }

    </script>

    <style type="text/css">

        /*audio:-webkit-full-page-media, video:-webkit-full-page-media {
                max-height: 100%;
                max-width: 100%;
            }*/
        user agent stylesheet
        video:-webkit-full-page-media {
            position: absolute;
            top: 0px;
            right: 0px;
            bottom: 0px;
            left: 0px;
            margin: auto;
        }
        user agent stylesheet
        video {
            object-fit: contain;
        }
    </style>
}
<body style="background-color: ButtonFace; font-size: 17px">
    <div class="easyui-panel" title="查询条件" style="height: 70px; padding: 5px; background: #fafafa; width: 1700px;">
        <form id="query" method="post">
            <table>
                <tr>
                    <td>
                        订单号：
                    </td>
                    <td>
                        <input id="txtOrderNo" name="txtOrderNo" type="text" style="width: 140px;" />
                    </td>
                    <td></td>
                    <td>
                        <a id="btnSerach" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <table id="dg" style="width:400px;height:250px"></table>   
    @*<table id="dg" title="" style="min-height: 600px;">
            <tr>
                <td>订单号</td>
                <td><span id="spOrderNo"></span></td>
            </tr>
            <tr>
                <td>审核日期</td>
                <td><span id="spCheckDate"></span> <a id="showVideo" href="" target="_blank">查看视频</a></td>
            </tr>
            <tr>
                <td>审核位</td>
                <td><span id="spCheckLoacation"></span></td>
            </tr>
        </table>*@
 
    
    @*<div id="dlg" class="easyui-dialog" style="padding: 2px"
         data-options="closed:true,buttons:'#dlg-buttons'">
       
    </div>*@
     
    <script src="@Url.Content("~/Scripts/common/xdate.js")" type="text/javascript"></script>
</body>


